// Get from db
// Store in easy to use format
include_once('assets/snippets/shoppingCart/kiwee.class.php');
$kiwee = new Kiwee();

if ($kiwee->config['cart_forcelogin'] == 'ENABLED'){	
   $ret = $kiwee->getCustomerInfo($_SESSION['webInternalKey']);
}

$dbcompanyname = isset($ret['companyname']) ? $ret['companyname'] : ''; 
$dbfname = isset($ret['fname']) ? $ret['fname'] : '';
$dblname = isset($ret['lname']) ? $ret['lname'] : '';
$dbaddr1 = isset($ret['addr1']) ? $ret['addr1'] : '';
$dbaddr2 = isset($ret['addr2']) ? $ret['addr2'] : '';
$dbcity = isset($ret['city']) ? $ret['city'] : '';
$dbstate = isset($ret['state']) ? $ret['state'] : '';
$dbzip = isset($ret['zip']) ? $ret['zip'] : '';
$dbcountry = isset($ret['country']) ? $ret['country'] : '';
$dbphone = isset($ret['phone_1']) ? $ret['phone_1'] : '';
$dbext = isset($ret['ext_1']) ? $ret['ext_1'] : '';
$dbfax = isset($ret['fax']) ? $ret['fax'] : '';
$dbemail = isset($_SESSION['webEmail']) ? $_SESSION['webEmail'] : '';

echo '<div id="CheckoutPaymentFormDiv" style="width: 95%;">';

echo '<div id="PaymentInfoHeader" style="margin-left: auto; margin-right: auto; width:610px; height: 25px; padding-top: 5px; padding-left: 10px; background-color: #497AFF; color: #FFF; font-size: 16px; font-weight: bold;">Payment Information</div>';
echo '<div id="paymentinfodetail" style="margin-left: auto; margin-right: auto; width: 600px; height: 160px; padding: 10px; background-color: #E3E8E8;">';
echo '<div id="paymentcardtypefield" style="width: 28%; float:right; padding-top: 10px; ">';
echo '<select tabindex="2" id="paymentcardtype">';
echo '<option value="VISA">Visa</option>';
echo '<option value="MC">Master Card</option>';
echo '<option value="AMEX">American Express</option>';
echo '<option value="DISC">Discover</option>';
echo '<option value="DINC">Diners Club</option>';
echo '<option value="JCB">JCB</option>';
echo '</select>';
echo '</div>';
echo '<div id="processorderdiv-short" style="width : 35%; float:right; display: none;"></div>';
echo '<div id="paymentcardtypelabel" style="width: 16%; float:right; padding-top: 10px; color: #54534C; font-size: 14px; font-weight: bold; padding-right: 10px;">Card Type:*</div>';

echo '<div id="paymentpaytypefield" style="width: 30%; float:right; padding-top: 10px; padding-right: 30px; ">';
echo '<select id="paymenttype" tabindex="1" onClick="updatepaymentform();">';
echo $kiwee->paymentTypes();
echo '</select>';
echo '</div>';
echo '<div id="paymentpaytypelabel" style="width: 16%; float:left;  padding-top: 10px; color: #54534C; font-size: 14px; font-weight: bold;">Method: *</div>';
echo '<br /><br />';

echo '<div id="paymentnamefield" style="width: 70%; padding-top: 10px; float:right; "><input tabindex="3" type="text" id="paymentnameoncard" size="35" /></div>';
echo '<div id="paymentnamelabel" style="width: 30%; padding-top: 10px; float:left; color: #54534C; font-size: 14px; font-weight: bold; ">Name as it Appears on Card:</div>';
echo '<br /><br />';

echo '<div id="paymentcvvcodefield" style="width: 9%; padding-top:10px; float: right; "><input type="text" id="paymentcvvcode" tabindex="5" size="3" /></div>';
echo '<div id="paymentcvvcodelabel" style="width: 10%; padding-top: 10px; float: right;color: #54534C; font-size: 14px; font-weight: bold; padding-right: 17px;">CVV2: *</div>';
echo '<div id="paymentcardnumberfield" style="width: 25%; padding-top: 10px; float:right; padding-left: 10px; padding-right: 138px;"><input tabindex="4" type="text" id="paymentcardnumber" size="30" /></div>';
echo '<div id="paymentcardnumberlabel" style="width: 19%; padding-top: 10px; float:left;  color: #54534C; font-size: 14px; font-weight: bold;">Card Number:*</div>';
echo '<div id="paymentroutingfield" style="width: 25%; padding-top: 10px; float:right; padding-right: 262px; display: none;" ><input tabindex="100" type="text" id="paymentroutingnumber" size="30" /></div>';
echo '<div id="paymentroutinglabel" style="width: 19%; padding-top: 10px; float:left;  color: #54534C; font-size: 14px; font-weight: bold; display: none;" >Routing:</div>';
echo '<br /><br />';

echo '<div id="paymentexpyrfield" style="width: 48%; float:right; padding-top: 10px; ">';
echo '<select id="paymentexpyr" tabindex="7" >';
echo '<option value="2007">2007</option>';
echo '<option value="2008">2008</option>';
echo '<option value="2009">2009</option>';
echo '<option value="2010">2010</option>';
echo '<option value="2011">2011</option>';
echo '<option value="2012">2012</option>';
echo '<option value="2013">2013</option>';
echo '<option value="2014">2014</option>';
echo '<option value="2015">2015</option>';
echo '<option value="2016">2016</option>';
echo '</select>';
echo '</div>';

echo '<div id="paymentexpmofield" style="width: 26%; float:right; padding-top: 10px; padding-right: 12px;">';
echo '<select id="paymentexpmo" tabindex="6" >';
echo '<option value="01">01 - January</option>';
echo '<option value="02">02 - February</option>';
echo '<option value="03">03 - March</option>';
echo '<option value="04">04 - April</option>';
echo '<option value="05">05 - May</option>';
echo '<option value="06">06 - June</option>';
echo '<option value="07">07 - July</option>';
echo '<option value="08">08 - August</option>';
echo '<option value="09">09 - September</option>';
echo '<option value="10">10 - October</option>';
echo '<option value="11">11 - November</option>';
echo '<option value="12">12 - December</option>';

echo '</select>';
echo '</div>';
echo '<div id="paymentexplabel" style="width: 18%; float:left;  padding-top: 10px; color: #54534C; font-size: 14px; font-weight: bold;">Expiration: *</div>';
echo '<br /><br /><br />';
echo '<div id="processorderdiv" style="width: 25%;float:right; "><button id="creditbutton" onClick="processcheckout("creditcard");">Process Order</button></div>';
echo '</div>';
echo '</div>';
